package com.hz.basic.service.impl;

import com.hz.basic.entity.FixedInformationDicEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hz.common.utils.PageUtils;
import com.hz.common.utils.Query;

import com.hz.basic.dao.CbBookDao;
import com.hz.basic.entity.CbBookEntity;
import com.hz.basic.service.CbBookService;


@Service("cbBookService")
public class CbBookServiceImpl extends ServiceImpl<CbBookDao, CbBookEntity> implements CbBookService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<CbBookEntity> page = this.page(
                new Query<CbBookEntity>().getPage(params),
                new QueryWrapper<CbBookEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<CbBookEntity> getBookList(long userId, Long eid) {
        return this.baseMapper.getBookList(userId, eid);
    }

    @Override
    public List<CbBookEntity> getCommonBookList(long userId, Long eid, String classify, String title) {
        return this.baseMapper.getCommonBookList(userId, eid, classify, title);
    }

    @Override
    public FixedInformationDicEntity getFixedInformation(String name) {
        return this.baseMapper.getFixedInformation(name);
    }

}